package com.piece.core.framework.support.convert;

import org.springframework.core.convert.converter.Converter;
import java.sql.Timestamp;
import java.util.Date;

/**
 * 时间戳转换器
 */
public class TimestampConverter implements Converter<Date, Timestamp> {

    @Override
    public Timestamp convert(Date date) {
        if (null != date) {
            return new Timestamp(date.getTime());
        }
        return null;
    }
}
